package com.inviteOrder.state;

import com.inviteOrder.strategy.RewardStrategyContext;

/**
 * 返奖中状态
 * @author 大忽悠
 * @create 2022/10/17 11:00
 */
public class RewardingState implements RewardState{
    private Boolean resultFlag=Boolean.FALSE;

    /**
     * 按照当前状态执行
     *
     * @param rewardStateContext 返奖状态上下文
     * @param request            请求对象
     */
    @Override
    public void doReward(RewardStateContext rewardStateContext, Request request) {
        RewardStrategyContext rewardStrategyContext = rewardStateContext.getRewardStrategyContext();
        resultFlag=rewardStrategyContext.doReward(request.getUid());
    }

    @Override
    public Boolean getResultFlag() {
        return resultFlag;
    }
}
